
Translink Logger Installation Notes
-----------------------------------

The Translink Logger application is a windows service that runs in the background whenever the PC is turned on.
It does not require a user to be logged on.

The output from this service is a series of PNG images containing various charts for each measurement device.
Typically these images are placed in a directory along with HTML files (included) to allow them to be displayed as a web page.
In addition they can also be placed on a web server for internet access, or any other use required.
These PNG files are overwritten each time a new measurement message is processed, so the amount of file space will not grow over time.
If you wish to keep the files they can be copied (either manually or using a scheduled task) on a regular basis to another location.

The Translink Logger application produces a series of TXT files that are used to store all the current measurement values.
These files are also read during startup so the application can pick up from where it was in the case of a PC restart etc.
The files are overwritten and do not grow in size.
They should be copied or backed up regularly in case of a PC failure. 

If configured via the registry, a log file can be created for fault finding etc. This file is not overwritten and will quickly grow in size.
It is recommended that this file only be enabled while fault finding, otherwise turned off via the registry.

Note: The broadcast frequency for each measurement from C-Bus must be less than 5 minutes maximum (4 minutes to be on the safe side).

There are a few steps involved in setting up the installation, which can vary from one installation to another which is why we have elected to use this method of installation.

Follow carefully each step in turn and modify the settings for your particular installation.

Pre Requisites
--------------
Installed and functioning Translink Controller with firmware V3.0.2 or later
Installed and configured C-Bus measurement devices (e.g. temp sensors, current sensor etc.)
Translink Controller configured to display the measurement values.


New Requirements
----------------
Translink Programming & Debug Adaptor
PC with RS232 Serial Port (physical or virtual)
Translink Logger application
Translink Logger web files (optional)


Installation Steps
------------------

1/ Connect the Programming & Debug adaptor to the translink.

2/ Connect the Debug port of the Programming & Debug adaptor to the PC RS232 port.
   This can be a direct connection or via a USB to Serial adaptor or serial to IP server etc.

3/ Unzip the TranslinkLogger.zip file to a temporary directory.
   You should have the following directories;
      Application
      HTML
      Reg
      Service

4/ Copy the entire contents of the Application directory to a suitable location
   Recommended location;
   For Windows x86
   C:\Program Files\Hamfield\TranslinkLogger\
   Or
   For Windows x64
   C:\Program Files (x86)\Hamfield\TranslinkLogger\

5/ Edit (using notepad or similar) the TranslinkLogger.reg file in the Reg directory to match your particular installation.
   This file contains the settings that the Translink logger application will use for your particular installation.
   When complete, save the file, then double click on it to run it. This will enter the appropriate values into the Windows Registry.
   You can do this more than once if you need to make a change. 
   Alternatively if you are familiar with editing the registry with "regedit" you can run the file as delivered and make your changes directly.
   Note: the translinkLogger.reg file contains instructions on what the various settings do.

6/ Copy the contents of the HTML directory to a suitable location.
   This is also where the output PNG files will be placed.
   The location could just be a directory or a web server if desired.
   Edit (using notepad or similar) the Index.HTML file to match your installation (instructions are in the file)

7/ Install TranslinkLogger.exe as a service.
   To install Translogger as a service, you have to use the Microsoft "installutil.exe" utility.
   You run it from a "Command Prompt" with admin privileges (run as administrator) and you have to use full paths to both the utility and the executable.
   Search the PC for the utility. There may be more than one so use the one from the V4 .net framework folder when you find it.
   E.G 
   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe "C:\Program Files (x86)\Hamfield\TranslinkLogger\TranslinkLogger.exe"
   Once the service is installed, use the service control manager (control panel -> Administrative Tools -> Services) to start it.
   It is called TranslinkLoggerService.
   
Congratulations, the application should now be working.


Testing
-------

Go to the directory where the output files are placed and check for the presence of newly created PNG files.
If you configured a log file in the registry settings, open the file and check for any errors.
Double click the index.html file and a web page should open in your default browser, showing the charts.
